#pragma once

#include "GdiplusHelper.h"
#include "DialogExt.h"

using namespace Gdiplus;

class CControlExt
{
public:
	CControlExt();
	virtual ~CControlExt();

protected:
	virtual void DrawBackground() {}
	virtual void DrawControl() {}
	virtual void DrawString() {}

public:
	BOOL SetFontSize(int nFontSize);
	BOOL SetFontStyle(int nFontStyle);
	BOOL SetFontSizeUnit(Gdiplus::Unit nFontUnit);
	BOOL SetFontFamily(CString strFontFamily);
	BOOL SetFontColor(int nRed,int nGreen, int nBule);

	void SetAlignFormat(StringAlignment align);
	void SetLineAlignFormat(StringAlignment align);

protected:
	CString m_strWindowText;

	CDC* m_pMemBgDC;
	CRect m_rectWindow;

	int m_nFontSize, m_nFontStyle;

	Gdiplus::Font *m_pFont;
	Gdiplus::Unit m_nFontUnit;
	Gdiplus::FontFamily* m_pFontFamily;
	
	Gdiplus::SolidBrush *m_pBrush;
	Gdiplus::StringFormat m_nStringFormat;
};